home *** CD-ROM | disk | FTP | other *** search
- Path: hilbert.dnai.com!usenet
- From: Victor Bazarov <vbazarov@imsisoft.com>
- Newsgroups: comp.lang.c
- Subject: Re: (void(far *)()) 0
- Date: Wed, 07 Feb 1996 11:05:55 -0800
- Organization: IMSI
- Message-ID: <3118F813.41BF@imsisoft.com>
- References: <341998718.10858110@magnet.at> <31165B9D.398E@imsisoft.com> <4f66c0$cn0@solutions.solon.com>
- NNTP-Posting-Host: 204.182.61.84
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (Win95; I)
-
- Peter Seebach wrote:
- >
- > In article <31165B9D.398E@imsisoft.com>,
- > Victor Bazarov <vbazarov@imsisoft.com> wrote:
- > >> .... = (void(far *)()) 0;
- >
- > >> Now I want to know if my assumption is right and
- > >> in case it is, what does this mean for 0 ?
- >
- > >Nothing but what you've said -- cast. '0' has type 'int',
- > >and must be converted into pointer to function in order
- > >to be properly assigned.
- >
- > Not exactly.
- >
- > 0 is a special case. Zero cast to a pointer type is a null pointer of that
- > type. Or rather, *a constant zero* is. An integer with value zero may
- > produce different results.
-
- As I undestood, this "may produce different results":
-
- typedef void (far *pVOIDVOID)();
- int zero = 0;
- pVOIDVOID funky;
- funky = (void(far *)()) zero;
-
- than
-
- typedef void (far *pVOIDVOID)();
- pVOIDVOID funky;
- funky = (void(far *)()) 0;
-
- ?
-
- > A textual zero, cast to pointer type, points at no object; this is magic.
- >
- > Before you try to correct or clarify this, *make sure you have read the
- > C FAQ and understand the relevant points.*
-